package com.swjd.jedis;

import org.junit.Test;
import redis.clients.jedis.Jedis;

import java.util.Set;

public class JedisDemo1 {
    public static void main(String[] args) {
        //创建jedis对象                redis地址          端口
        Jedis jedis = new Jedis("192.168.164.135",6379);
        //测试
        String ping = jedis.ping();
        System.out.println(ping);
        jedis.close();
    }
    @Test
    public void demo1(){
        //创建jedis对象                redis地址          端口
        Jedis jedis = new Jedis("192.168.164.135",6379);
        jedis.set("name","lucy");
        Set<String> keys = jedis.keys("*");
        for (String key :keys){
            System.out.println(key);
        }
        jedis.close();
    }
}
